<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="SortField,mx.collections.SortField,caseInsensitive,compareFunction,descending,name,numeric,reverse" name="keywords">
<title>mx.collections.SortField</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'SortField - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/collections/SortField.html&amp;mx/collections/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;SortField</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class SortField"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.collections</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class SortField</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">SortField <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  Provides the sorting information required to establish a sort on a field
  or property in an existing view.
  Typically the sort is defined for collections of complex items, that is items
  in which the sort is performed on properties of those objects.
  As in the following example:
 
  <pre><code>
     var col:ICollectionView = new ArrayCollection();
     col.addItem({first:"Anders", last:"Dickerson"});
     var sort:Sort = new Sort();
     sort.fields = [new SortField("first", true)];
     col.sort = sort;
  </code></pre>
 
  There are situations in which the collection contains simple items, like
  <code>String</code>, <code>Date</code>, <code>Boolean</code>, etc.
  In this case, sorting should be applied to the simple type directly.
  When constructing a sort for this situation only a single sort field is
  required and should not have a <code>name</code> specified.
  For example:
 
  <pre><code>
     var col:ICollectionView = new ArrayCollection();
     col.addItem("California");
     col.addItem("Arizona");
     var sort:Sort = new Sort();
     sort.fields = [new SortField(null, true)];
     col.sort = sort;
  </code></pre>
 
  <p></p>
<a name="mxmlSyntaxSummary"></a><span class="classHeaderTableLabel">MXML Syntax</span><span style="display:none" id="showMxmlLink"><a onclick="toggleMXMLOnly();" href="#mxmlSyntaxSummary"><img class="collapsedImage" alt="collapsed" title="collapsed" src="../../images/collapsed.gif"> Show MXML Syntax</a>
<br>
</span><span id="hideMxmlLink"><a onclick="toggleMXMLOnly();" href="#mxmlSyntaxSummary"><img class="expandedImage" alt="expanded" title="expanded" src="../../images/expanded.gif"> Hide MXML Syntax</a></span>
<div class="mxmlSyntax" id="mxmlSyntax">   <p>The <code>&lt;mx:SortField&gt;</code> tag has the following attributes:</p>
   <pre>
  &lt;mx:SortField
  <b>Properties</b>
  caseInsensitive="false"
  compareFunction="<em>Internal compare function</em>"
  descending="false"
  name="null"
  numeric="null"
  /&gt;
  </pre>
 </div>
<script type="text/javascript" language="javascript">
<!--
setMXMLOnly();
--></script>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#caseInsensitive">caseInsensitive</a> : Boolean<div class="summaryTableDescription">
      Specifies whether the sort for this field should be case insensitive.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#compareFunction">compareFunction</a> : Function<div class="summaryTableDescription">
      The function that compares two items during a sort of items for the
      associated collection.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#descending">descending</a> : Boolean<div class="summaryTableDescription">
      Specifies whether the this field should be sorted in descending
      order.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#name">name</a> : String<div class="summaryTableDescription">
      The name of the field to be sorted.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#numeric">numeric</a> : Object<div class="summaryTableDescription">
      Specifies that if the field being sorted contains numeric
      (number/int/uint) values, or string representations of numeric values, 
   the comparitor use a numeric comparison.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#SortField()">SortField</a>(name:String = null, caseInsensitive:Boolean = false, descending:Boolean = false, numeric:Object = null)</div>
<div class="summaryTableDescription">
      Constructor.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#reverse()">reverse</a>():void</div>
<div class="summaryTableDescription">
     Reverse the criteria for this sort field.</div>
</td><td class="summaryTableOwnerCol">SortField</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="caseInsensitive"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">caseInsensitive</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>caseInsensitive:Boolean</code>&nbsp;&nbsp;[read-write]<p>
      Specifies whether the sort for this field should be case insensitive.
           </p><p>The default value is <code>false</code>.</p>
<p>This property can be used as the source for data binding.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get caseInsensitive():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set caseInsensitive(value:Boolean):void</code>
<br>
</div>
<a name="compareFunction"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">compareFunction</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>compareFunction:Function</code>&nbsp;&nbsp;[read-write]<p>
      The function that compares two items during a sort of items for the
      associated collection. If you specify a <code>compareFunction</code>
   property in a Sort object, Flex ignores any <code>compareFunction</code>
   properties of the Sort's SortField objects.
      </p><p>The compare function must have the following signature:</p>
           <p><code>function myCompare(a:Object, b:Object):int</code></p>
           <p>This function must return the following values:</p>
  
    <ul>
            <li>-1, if <code>a</code> should appear before <code>b</code> in
            the sorted sequence</li>
            <li>0, if <code>a</code> equals <code>b</code></li>
            <li>1, if <code>a</code> should appear after <code>b</code> in the
            sorted sequence</li>
      </ul>
           <p>The default value is an internal compare function that can perform 
   a string, numeric, or date comparison in ascending or descending order, 
   with case-sensitive or case-insensitive string comparisons.
      Specify your own function only if you need a need a custom comparison algorithm.
      This is normally only the case if a calculated field is used in a display.</p>
          <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get compareFunction():Function</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set compareFunction(value:Function):void</code>
<br>
</div>
<a name="descending"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">descending</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>descending:Boolean</code>&nbsp;&nbsp;[read-write]<p>
      Specifies whether the this field should be sorted in descending
      order.
           </p><p> The default value is <code>false</code> (ascending).</p>
     <p>This property can be used as the source for data binding.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get descending():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set descending(value:Boolean):void</code>
<br>
</div>
<a name="name"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">name</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>name:String</code>&nbsp;&nbsp;[read-write]<p>
      The name of the field to be sorted.
           </p><p>The default value is <code>null</code>.</p>
<p>This property can be used as the source for data binding.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get name():String</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set name(value:String):void</code>
<br>
</div>
<a name="numeric"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">numeric</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>numeric:Object</code>&nbsp;&nbsp;[read-write]<p>
      Specifies that if the field being sorted contains numeric
      (number/int/uint) values, or string representations of numeric values, 
   the comparitor use a numeric comparison.
      If this property is <code>false</code>, fields with string representations
   of numbers are sorted using strings comparison, so 100 precedes 99, 
   because "1" is a lower string value than "9".
      If this property is <code>null</code>, the first data item
   is introspected to see if it is a number or string and the sort
   proceeds based on that introspection
           </p><p>The default value is <code>false</code>.</p>
<p>This property can be used as the source for data binding.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get numeric():Object</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set numeric(value:Object):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="SortField()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">SortField</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function SortField(name:String = null, caseInsensitive:Boolean = false, descending:Boolean = false, numeric:Object = null)</code><p>
      Constructor.
           </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">name</span>:String</code> (default = <code>null</code>)<code></code> &mdash; The name of the property that this field uses for
                  comparison.
                  If the object is a simple type, pass <code>null</code>.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">caseInsensitive</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; When sorting strings, tells the comparitor
                  whether to ignore the case of the values.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">descending</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Tells the comparator whether to arrange items in
                  descending order.
      </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">numeric</span>:Object</code> (default = <code>null</code>)<code></code> &mdash; Tells the comparitor whether to compare sort items as
                  numbers, instead of alphabetically.
     </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="reverse()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">reverse</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function reverse():void</code><p>
     Reverse the criteria for this sort field.
     If the field was sorted in descending order, for example, sort it
     in ascending order.
          </p><p>Note: an ICollectionView does not automatically update when the
     SortFields are modified; call its <code>refresh()</code> method to
     update the view.</p>
     </div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
